import request from '@/utils/http'
import { UserInfo } from '@/types'

const PATH = '/users'

export function getUserInfoBatch(data: any) {
	return request({ url: PATH + '/getFollowInfos', method: 'post', data })
}

export async function getOtherUserInfo(params: any) {
	const res = await request({ url: `/user/profile/otherUser/${params.userId}`, method: 'get' })
	const __ = res.data as UserInfo
	__.nickName = __.username
	__.userName = __.username
	__.userId = __.id
	return res
}

export function getUserVipStarLogos(data: any) {
	return request({ url: PATH + '/getUserVipStarLogos', method: 'post', data })
}

export function getUserCombines(params: any) {
	return request({ url: PATH + '/combines', method: 'get', params })
}

// export function getUserFollowings(params: any) {
// 	return request({ url: `/users/getfollowings`, method: 'get', params })
// }
//
// export function getUserFollowers(params: any) {
// 	return request({ url: `/users/getfollowers`, method: 'get', params })
// }
//
// export function followRequest(data: any) {
// 	return request({ url: `/profile/followrequest`, method: 'post', data })
// }
//
// export function followCancel(data: any) {
// 	return request({ url: `/profile/followcancel`, method: 'post', data })
// }
//
// export function getFollowRequests(params: any) {
// 	return request({ url: `/profile/getfollowrequests`, method: 'get', params })
// }
//
// export function removeFollow(data: any) {
// 	return request({ url: `/profile/followcancel`, method: 'post', data })
// }
//
// export function acceptFollowRequest(data: any) {
// 	return request({ url: `/profile/followaccept`, method: 'post', data })
// }
//
// export function rejectFollowRequest(data: any) {
// 	return request({ url: `/profile/followreject`, method: 'post', data })
// }
//
// export function getFollowers(params: any) {
// 	return request({ url: `/profile/getfollowers`, method: 'get', params })
// }
//
// export function getFollowings(params: any) {
// 	return request({ url: `/profile/getfollowings`, method: 'get', params })
// }

export const getMyFanList = (params: any) =>
	request({ url: '/user/profile/fanList', method: 'get', params })
export const getMyFollowList = (params: any) =>
	request({ url: '/user/profile/followList', method: 'get', params })
export const getOtherFanList = (params: any) =>
	request({ url: '/user/profile/otherFanList', method: 'get', params })
export const getOtherFollowList = (params: any) =>
	request({ url: '/user/profile/otherFollowList', method: 'get', params })
export const getFollowApplyList = (params: any) =>
	request({ url: '/user/profile/followApplyList', method: 'get', params })
export const followRequest = (data: any) =>
	request({ url: '/user/profile/follow', method: 'post', data })
export const followCancel = (data: any) =>
	request({ url: '/user/profile/followCancel', method: 'post', data })
export const followAccept = (data: any) =>
	request({ url: '/user/profile/followAccept', method: 'post', data })
export const followReject = (data: any) =>
	request({ url: '/user/profile/followReject', method: 'post', data })
